package io;

import javax.sound.sampled.Line;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.nio.charset.StandardCharsets;
import java.util.Scanner;

public class TestNote {
    public static void main(String[] args) throws IOException {
        Scanner scanner=new Scanner(System.in);
        FileOutputStream fos=new FileOutputStream("note.txt",true);

        while (true){
            System.out.println("请输入文字");
            String line=scanner.nextLine();
            if(!line.equals("exit")){
                byte [] date=line.getBytes(StandardCharsets.UTF_8);
                fos.write(date);
            }else {
                System.out.println("写出完成,退出程序");
                break;
            }

        }
        fos.close();


    }
}
